home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1999 April / Cd Pc Users extra 19 abril 1999.iso / Prog / Inst / Scroll / frmAbout.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-01-14  |  6.0 KB  |  177 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAbout 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "About your Application"
  6.    ClientHeight    =   4185
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5985
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4185
  14.    ScaleWidth      =   5985
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.PictureBox picScroll 
  17.       Appearance      =   0  'Flat
  18.       AutoRedraw      =   -1  'True
  19.       BackColor       =   &H00000000&
  20.       ForeColor       =   &H000000FF&
  21.       Height          =   2535
  22.       Left            =   360
  23.       ScaleHeight     =   167
  24.       ScaleMode       =   3  'Pixel
  25.       ScaleWidth      =   343
  26.       TabIndex        =   0
  27.       Top             =   720
  28.       Width           =   5175
  29.    End
  30.    Begin VB.Label lblExit 
  31.       AutoSize        =   -1  'True
  32.       BackStyle       =   0  'Transparent
  33.       Caption         =   "EXIT"
  34.       BeginProperty Font 
  35.          Name            =   "MS Sans Serif"
  36.          Size            =   9.75
  37.          Charset         =   0
  38.          Weight          =   700
  39.          Underline       =   0   'False
  40.          Italic          =   0   'False
  41.          Strikethrough   =   0   'False
  42.       EndProperty
  43.       ForeColor       =   &H0000FFFF&
  44.       Height          =   240
  45.       Left            =   5160
  46.       TabIndex        =   2
  47.       Top             =   3720
  48.       Width           =   510
  49.    End
  50.    Begin VB.Label Label1 
  51.       AutoSize        =   -1  'True
  52.       BackStyle       =   0  'Transparent
  53.       Caption         =   "You Application Name"
  54.       BeginProperty Font 
  55.          Name            =   "MS Sans Serif"
  56.          Size            =   18
  57.          Charset         =   0
  58.          Weight          =   400
  59.          Underline       =   0   'False
  60.          Italic          =   0   'False
  61.          Strikethrough   =   0   'False
  62.       EndProperty
  63.       ForeColor       =   &H000000FF&
  64.       Height          =   435
  65.       Left            =   120
  66.       TabIndex        =   1
  67.       Top             =   0
  68.       Width           =   3585
  69.    End
  70. Attribute VB_Name = "frmAbout"
  71. Attribute VB_GlobalNameSpace = False
  72. Attribute VB_Creatable = False
  73. Attribute VB_PredeclaredId = True
  74. Attribute VB_Exposed = False
  75. Option Explicit
  76. Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
  77. Private Declare Function GetTickCount Lib "kernel32" () As Long
  78. Const DT_BOTTOM As Long = &H8
  79. Const DT_CALCRECT As Long = &H400
  80. Const DT_CENTER As Long = &H1
  81. Const DT_EXPANDTABS As Long = &H40
  82. Const DT_EXTERNALLEADING As Long = &H200
  83. Const DT_LEFT As Long = &H0
  84. Const DT_NOCLIP As Long = &H100
  85. Const DT_NOPREFIX As Long = &H800
  86. Const DT_RIGHT As Long = &H2
  87. Const DT_SINGLELINE As Long = &H20
  88. Const DT_TABSTOP As Long = &H80
  89. Const DT_TOP As Long = &H0
  90. Const DT_VCENTER As Long = &H4
  91. Const DT_WORDBREAK As Long = &H10
  92. Private Type RECT
  93.         Left As Long
  94.         Top As Long
  95.         Right As Long
  96.         Bottom As Long
  97. End Type
  98. 'the actual text to scroll. This could also be loaded in from a text file
  99. Const ScrollText As String = "My Application Title" & vbCrLf & _
  100.                              vbCrLf & vbCrLf & _
  101.                              "Producer: Myself" & vbCrLf & _
  102.                              "Executive Producer: Myself" & _
  103.                              vbCrLf & "Main programmer: Myself" & _
  104.                              vbCrLf & "Main graphic artist: Myself" & _
  105.                              vbCrLf & vbCrLf & _
  106.                              "Sample from:" & _
  107.                               vbCrLf & _
  108.                              "HTTP://WWW.VBEXPLORER.COM"
  109.                              
  110. Dim EndingFlag As Boolean
  111. Private Sub Form_Activate()
  112. RunMain
  113. End Sub
  114. Private Sub Form_Load()
  115. picScroll.ForeColor = vbYellow
  116. picScroll.FontSize = 14
  117. End Sub
  118. Private Sub RunMain()
  119. Dim LastFrameTime As Long
  120. Const IntervalTime As Long = 40
  121. Dim rt As Long
  122. Dim DrawingRect As RECT
  123. Dim UpperX As Long, UpperY As Long 'Upper left point of drawing rect
  124. Dim RectHeight As Long
  125. 'show the form
  126. frmAbout.Refresh
  127. 'Get the size of the drawing rectangle by suppying the DT_CALCRECT constant
  128. rt = DrawText(picScroll.hdc, ScrollText, -1, DrawingRect, DT_CALCRECT)
  129. If rt = 0 Then 'err
  130.     MsgBox "Error scrolling text", vbExclamation
  131.     EndingFlag = True
  132.     DrawingRect.Top = picScroll.ScaleHeight
  133.     DrawingRect.Left = 0
  134.     DrawingRect.Right = picScroll.ScaleWidth
  135.     'Store the height of The rect
  136.     RectHeight = DrawingRect.Bottom
  137.     DrawingRect.Bottom = DrawingRect.Bottom + picScroll.ScaleHeight
  138. End If
  139. Do While Not EndingFlag
  140.     If GetTickCount() - LastFrameTime > IntervalTime Then
  141.                     
  142.         picScroll.Cls
  143.         
  144.         DrawText picScroll.hdc, ScrollText, -1, DrawingRect, DT_CENTER Or DT_WORDBREAK
  145.         
  146.         'update the coordinates of the rectangle
  147.         DrawingRect.Top = DrawingRect.Top - 1
  148.         DrawingRect.Bottom = DrawingRect.Bottom - 1
  149.         
  150.         'control the scolling and reset if it goes out of bounds
  151.         If DrawingRect.Top < -(RectHeight) Then 'time to reset
  152.             DrawingRect.Top = picScroll.ScaleHeight
  153.             DrawingRect.Bottom = RectHeight + picScroll.ScaleHeight
  154.         End If
  155.         
  156.         picScroll.Refresh
  157.         
  158.         LastFrameTime = GetTickCount()
  159.         
  160.     End If
  161.     DoEvents
  162. Unload Me
  163. Set frmAbout = Nothing
  164. End Sub
  165. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  166. lblExit.ForeColor = vbYellow
  167. End Sub
  168. Private Sub Form_Unload(Cancel As Integer)
  169.     EndingFlag = True
  170. End Sub
  171. Private Sub lblExit_Click()
  172. EndingFlag = True
  173. End Sub
  174. Private Sub lblExit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  175. lblExit.ForeColor = vbRed
  176. End Sub
  177.